<include file="../header" />
</head>
<script language="javascript" src="/Template/js/ImgPreview.js"></script>
<body class="J_scroll_fixed">
<script type="text/javascript">
    $(function() {

        if("{$hisRx.patient_name}" != ""){
            if(confirm("是否加载 {$hisRx.patient_name}_{$hisRx.side}_{$hisRx.admin_name}({$hisRx.update_time}) 更新的处方记录？")){
                var id = "{$workorder.workorder_id}";
                var hisId = "{$hisRx.rx_common_id}";

                var url ="/admin/workorder/rx?id="+id+"&hisId="+hisId;
                window.location.href = url;
            }
        }
        $("select[name='patient']").change(function () {
            var id = "{$workorder.workorder_id}";
            var hisId = $("select[name='patient']").val();
            if(!confirm("是否加载 "+$("select[name='patient']").find("option:selected").text()+"的处方记录？")){
                return false;
            }else {
                var url = "/admin/workorder/rx?id=" + id + "&hisId=" + hisId;
                window.location.href = url;
            }
        });

        if($("select[name='rt4']").val() == "CTLSO") {
            $(".type-ctlso").show();
        };
        if($("select[name='rt4']").val() == "TLSO") {
            $(".type-tlso").show();
        };

        $("select[name='rt4']").change(function () {
            if($("select[name='rt4']").val() == "CTLSO") {
                $(".type-ctlso").show();
                $(".type-tlso").hide();
            };
            if($("select[name='rt4']").val() == "TLSO") {
                $(".type-tlso").show();
                $(".type-ctlso").hide();
            };
            if($("select[name='rt4']").val() == "LSO") {
                $(".type-tlso").hide();
                $(".type-ctlso").hide();
            };
        });

        $("input[name=completed]").click(function() {
            if($("input[name=completed]").is(':checked')) {
                $("button.btn_submit").text("完成");
            }else{
                $("button.btn_submit").text("更新");
            }
        });

        $("button.btn_submit").click(function() {
            if($("input[name=completed]").is(':checked')) {
                if (confirm("勾选'完成'后提交处方单将无法再次修改，是否继续提交")) {
                    $("button.btn_submit").hide();
                } else {
                    return false;
                }
            }else{
                $("button.btn_submit").hide();
            }
        })

//        $("button.btn_submit").click(function() {
//
//            if($("input[name=completed]").is(':checked')) {
//                if (!confirm("勾选'完成'后提交处方单将无法再次修改，是否继续提交？")) {
//                    return false;
//                }else{
////                    $("form").submit();
//                }
//            }
//        });
    })
</script>
<style>
    .control-label {
        font-weight: bold;
    }
</style>
<div class="wrap jj">
    <div class="common-form">
        <form method="post" class="form-horizontal J_ajaxForm" action="{:U('Workorder/rx_tlso_post')}" onkeydown="if(event.keyCode==13)return false;" >
            <input type="hidden" name="workorderId" value="{$workorderId}" />
            <input type="hidden" name="rxId" value="{$rxId}" />
            <fieldset>
                <div class="control-group">
                    <label class="control-label"></label>
                    <div class="controls" style="font-weight: bold; font-size: larger">
                        {$workorder.patient_name}
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">历史病例:</label>
                    <div class="controls">
                        <select name="patient" style="width: 600px">
                            {:getRxCommonSelectOptionHtml($workorder['rx_common_id'], $workorder['patient_name'], $workorder['workorder_type'])}
                        </select>
                    </div>
                </div>
                <div style="margin-left: 11rem" class="control-group">
                    <if condition="$workorder['photo0'] neq ''">
                        <span style="color: #45a1dd; font-weight: bold; font-size: 18px;margin-left: 1rem">左键放大显示、右键保存图片：</span>
                    </if>
                    <br/><br/>
                    <div>
                        <if condition="$workorder['photo0'] neq ''">
                            <div style="float:left;margin-left: 1rem" class="container-item">
                                <img src="{$workorder['photo0']}" id="img1" style="width:400px;height:auto;">
                            </div>
                        </if>
                        <if condition="$workorder['photo1'] neq ''">
                            <div style="float:left;margin-left: 1rem" class="container-item">
                                <img src="{$workorder['photo1']}" id="img2" style="width:400px;height:auto;">
                            </div>
                        </if>
                        <if condition="$workorder['photo2'] neq ''">
                            <div style="float:left;margin-left: 1rem" class="container-item">
                                <img src="{$workorder['photo2']}" id="img3" style="width:400px;height:auto;">
                            </div>
                        </if>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">诊断：</label>
                    <div class="controls">
                        <textarea style="height:5rem; width: 40rem;" name="rt0">{$rx.rt0}</textarea>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">主要畸形描述：</label>
                    <div class="controls">
                        <textarea style="height:5rem; width: 40rem;" name="rt1">{$rx.rt1}</textarea>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">治疗计划说明:</label>
                    <div class="controls">
                        <select name="rt2">
                            {:getFormDictSelectOption($rx['rt2'],'therapy_schedule','rx_tlso',1)}
                        </select>
                        其他：
                        <input type="text" class="input"  style="width: 450px" name="rt3" value="{$rx.rt3}">
                    </div>
                </div>
                <hr class="half-rule">
                <div class="control-group">
                    <label class="control-label">脊柱矫形器类型：</label>
                    <div class="controls">
                        <select name="rt4">
                            {:getFormDictSelectOption($rx['rt4'],'type','rx_tlso',1)}
                        </select>
                    </div>
                    <div style="display: none" class="type-ctlso">
                        <div class="controls">
                            颈椎对线要求：
                            <input type="text" class="input" style="width: 600px" name="rt5" value="{$rx.rt5}">
                        </div>
                        <div class="controls">
                            头箍：
                            <select name="rt6">
                                {:getFormDictSelectOption($rx['rt6'],'has','rx_tlso',1)}
                            </select>
                            头箍材料：
                            <input type="text" class="input"  style="width: 200px" name="rt7" value="{$rx.rt7}">
                        </div>
                    </div>
                    <div style="display: none" class="type-tlso">
                        <div class="controls">
                            类型：
                            <select name="rt8">
                                {:getFormDictSelectOption($rx['rt8'],'tlso_type','rx_tlso',1)}
                            </select>
                            头箍材料：
                            <input type="text" class="input"  style="width: 100px" name="rt9" value="{$rx.rt9}">
                        </div>
                    </div>
                    <div class="controls">
                        躯干矢状面对线要求：
                        <input type="text" class="input" style="width: 600px" name="rt10" value="{$rx.rt10}">
                    </div>
                    <div class="controls">
                        躯干冠状面对线要求：
                        <input type="text" class="input" style="width: 600px" name="rt11" value="{$rx.rt11}">
                    </div>
                    <div class="controls">
                        躯干前方高度：
                        <input type="text" class="input" style="width: 100px" name="rt12" value="{$rx.rt12}">
                    </div>
                    <div class="controls">
                        躯干后方高度：
                        <input type="text" class="input" style="width: 100px" name="rt13" value="{$rx.rt13}">
                    </div>
                    <div class="controls">
                        躯干左侧高度：
                        <input type="text" class="input" style="width: 100px" name="rt14" value="{$rx.rt14}">
                    </div>
                    <div class="controls">
                        躯干右侧高度：
                        <input type="text" class="input" style="width: 100px" name="rt15" value="{$rx.rt15}">
                    </div>
                    <div class="controls">
                        躯干前方下缘到：
                        <input type="text" class="input" style="width: 200px" name="rt16" value="{$rx.rt16}">
                    </div>
                    <div class="controls">
                        躯干后方下缘到：
                        <input type="text" class="input" style="width: 200px" name="rt17" value="{$rx.rt17}">
                    </div>
                    <div class="controls">
                        躯干左侧下缘到：
                        <input type="text" class="input" style="width: 200px" name="rt18" value="{$rx.rt18}">
                    </div>
                    <div class="controls">
                        躯干右侧下缘到：
                        <input type="text" class="input" style="width: 200px" name="rt19" value="{$rx.rt19}">
                    </div>
                    <div class="controls">
                        需要加压的部位和说明：
                        <input type="text" class="input" style="width: 600px" name="rt20" value="{$rx.rt20}">
                    </div>
                    <div class="controls">
                        需要加压的部位和说明：
                        <input type="text" class="input" style="width: 600px" name="rt21" value="{$rx.rt21}">
                    </div>
                </div>

                <hr class="half-rule">

                <div class="control-group">
                    <label class="control-label">阴型及调整:</label>
                    <div class="controls">
                        <php>
                            for($i=0; $i<5; $i++) {
                            $mouldArr[$i]["id"] = $i;
                            $mouldArr[$i]["name"] = $formDict["mould_".$i];
                            }
                            if (strlen($rx["rt22"]) > 0) {
                            $mould_id=explode(',', $rx["rt22"]);
                            }

                        </php>
                        <foreach name="mouldArr" item="vo">
                            <label class="checkbox inline">
                                <php>$mould_id_checked=in_array($vo['id'],$mould_id)?"checked":"";</php>
                                <input value="{$vo.id}" type="checkbox" name="mould_id[]" {$mould_id_checked}>{$vo.name}&nbsp&nbsp&nbsp&nbsp
                            </label>
                        </foreach>
                    </div>
                    <div class="controls">
                        骨盆前凸调整：
                        <select style="width: 100px" name="rt23">
                            {:getFormDictSelectOption($rx['rt23'],'pelvic','rx_tlso',1)}
                        </select>
                        &nbsp&nbsp角度：
                        <input type="text" class="input" style="width: 50px" name="rt24" value="{$rx.rt24}">
                        °
                    </div>
                </div>
                <hr class="half-rule">
                <div class="control-group">
                    <label class="control-label">阳型调整：</label>
                    <div class="controls">
                        Build-up（填补）：
                        <input type="text" class="input" style="width: 714px" name="rt25" value="{$rx.rt25}" placeholder="部位，范围，高度">
                    </div>
                    <div class="controls">
                        加压：
                        <input type="text" class="input" style="width: 800px" name="rt26" value="{$rx.rt26}" placeholder="部位，范围，深度">
                    </div>
                    <div class="controls">
                        尺寸要求：
                        <input type="text" class="input" style="width: 772px" name="rt27" value="{$rx.rt27}" placeholder="">
                    </div>
                    <div class="controls">
                        翻边：
                        <input type="text" class="input" style="width: 800px" name="rt28" value="{$rx.rt28}" placeholder="部位1：部位2：部位3：部位……">
                    </div>
                </div>
                <hr class="half-rule">
                <div class="control-group">
                    <label class="control-label">材料：</label>
                    <div class="controls">
                        外壳：
                        <select name="rt29">
                            {:getFormDictSelectOption($rx['rt29'],'production','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        厚度：
                        <select name="rt30">
                            {:getFormDictSelectOption($rx['rt30'],'thickness','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        内衬：
                        <select name="rt31">
                            {:getFormDictSelectOption($rx['rt31'],'inner','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        贴纸图案要求：
                        <input type="text" class="input"  style="width: 473px" name="rt32" value="{$rx.rt32}">
                    </div>
                    <div class="controls">
                        其他说明：
                        <input type="text" class="input"  style="width: 500px" name="rt33" value="{$rx.rt33}">
                    </div>
                </div>
                <hr class="half-rule">
                <div class="control-group">
                    <label class="control-label">颈前枝条：</label>
                    <div class="controls">
                        材料：
                        <select style="width: 143px" name="rt34">
                            {:getFormDictSelectOption($rx['rt34'],'material','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        可调高度：
                        <input type="text" class="input"  style="width: 100px" name="rt35" value="{$rx.rt35}">
                    </div>
                    <div class="controls">
                        固定高度：
                        <input type="text" class="input"  style="width: 100px" name="rt36" value="{$rx.rt36}">
                    </div>
                    <div class="controls">
                        固定位置：
                        <input type="text" class="input"  style="width: 100px" name="rt37" value="{$rx.rt37}">
                    </div>
                    <div class="controls">
                        枝条免压垫：
                        <select style="width: 101px" name="rt38">
                            {:getFormDictSelectOption($rx['rt38'],'has','rx_tlso',1)}
                        </select>
                    </div>
                </div>
                <hr class="half-rule">

                <div class="control-group">
                    <label class="control-label">颈后枝条：</label>
                    <div class="controls">
                        材料：
                        <select style="width: 143px" name="rt39">
                            {:getFormDictSelectOption($rx['rt39'],'material','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        可调高度：
                        <input type="text" class="input"  style="width: 100px" name="rt40" value="{$rx.rt40}">
                    </div>
                    <div class="controls">
                        固定高度：
                        <input type="text" class="input"  style="width: 100px" name="rt41" value="{$rx.rt41}">
                    </div>
                    <div class="controls">
                        固定位置：
                        <input type="text" class="input"  style="width: 100px" name="rt42" value="{$rx.rt42}">
                    </div>
                    <div class="controls">
                        枝条免压垫：
                        <select style="width: 101px" name="rt43">
                            {:getFormDictSelectOption($rx['rt43'],'has','rx_tlso',1)}
                        </select>
                    </div>
                </div>
                <hr class="half-rule">

                <div class="control-group">
                    <label class="control-label">颈托：</label>
                    <div class="controls">
                        材料：
                        <select style="width: 143px" name="rt44">
                            {:getFormDictSelectOption($rx['rt44'],'material','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        前后倾角：
                        <select style="width: 115px" name="rt45">
                            {:getFormDictSelectOption($rx['rt45'],'ajust_angel','rx_tlso',1)}
                        </select>
                        &nbsp&nbsp角度：
                        <input type="text" class="input"  style="width: 100px" name="rt46" value="{$rx.rt46}">
                        °
                    </div>

                    <div class="controls">
                        颈托免压垫：
                        <select style="width: 101px" name="rt47">
                            {:getFormDictSelectOption($rx['rt47'],'has','rx_tlso',1)}
                        </select>
                    </div>
                </div>
                <hr class="half-rule">

                <div class="control-group">
                    <label class="control-label">枕托：</label>
                    <div class="controls">
                        材料：
                        <select style="width: 143px" name="rt48">
                            {:getFormDictSelectOption($rx['rt48'],'material','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        前后倾角：
                        <select style="width: 115px" name="rt49">
                            {:getFormDictSelectOption($rx['rt49'],'ajust_angel','rx_tlso',1)}
                        </select>
                        &nbsp&nbsp角度：
                        <input type="text" class="input"  style="width: 100px" name="rt50" value="{$rx.rt50}">
                        °
                    </div>

                    <div class="controls">
                        颈托免压垫：
                        <select style="width: 101px" name="rt51">
                            {:getFormDictSelectOption($rx['rt51'],'has','rx_tlso',1)}
                        </select>
                    </div>
                </div>
                <hr class="half-rule">

                <div class="control-group">
                    <label class="control-label">胸部枝条：</label>
                    <div class="controls">
                        <select style="width: 160px" name="rt52">
                            {:getFormDictSelectOption($rx['rt52'],'branchname','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        材料：
                        <select style="width: 115px" name="rt53">
                            {:getFormDictSelectOption($rx['rt53'],'chestmaterial','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        热塑材料：
                        <select style="width: 87px" name="rt54">
                            {:getFormDictSelectOption($rx['rt54'],'production','rx_tlso',1,3)}
                        </select>
                        &nbsp&nbsp其他：
                        <input type="text" class="input"  style="width: 100px" name="rt55" value="{$rx.rt55}">
                    </div>
                    <div class="controls">
                        厚度：
                        <select style="width: 115px" name="rt56">
                            {:getFormDictSelectOption($rx['rt56'],'thickness','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        枝条类型：
                        <select style="width: 115px" name="rt57">
                            {:getFormDictSelectOption($rx['rt57'],'branchtype','rx_tlso',1,4)}
                        </select>
                    </div>
                    <div class="controls">
                        枝条宽度：
                        <input type="text" class="input"  style="width: 100px" name="rt58" value="{$rx.rt58}">
                    </div>
                    <div class="controls">
                        枝条免压垫：
                        <select style="width: 101px" name="rt59">
                            {:getFormDictSelectOption($rx['rt59'],'has','rx_tlso',1)}
                        </select>
                    </div>
                </div>
                <hr class="half-rule">

                <div class="control-group">
                    <label class="control-label">背部枝条：</label>
                    <div class="controls">
                        <select style="width: 160px" name="rt60">
                            {:getFormDictSelectOption($rx['rt60'],'branchname','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        材料：
                        <select style="width: 115px" name="rt61">
                            {:getFormDictSelectOption($rx['rt61'],'chestmaterial','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        热塑材料：
                        <select style="width: 87px" name="rt62">
                            {:getFormDictSelectOption($rx['rt62'],'production','rx_tlso',1,3)}
                        </select>
                        &nbsp&nbsp其他：
                        <input type="text" class="input"  style="width: 100px" name="rt63" value="{$rx.rt63}">
                    </div>
                    <div class="controls">
                        厚度：
                        <select style="width: 115px" name="rt64">
                            {:getFormDictSelectOption($rx['rt64'],'thickness','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        枝条类型：
                        <select style="width: 115px" name="rt65">
                            {:getFormDictSelectOption($rx['rt65'],'branchtype','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        枝条宽度：
                        <input type="text" class="input"  style="width: 100px" name="rt66" value="{$rx.rt66}">
                    </div>
                    <div class="controls">
                        枝条免压垫：
                        <select style="width: 101px" name="rt67">
                            {:getFormDictSelectOption($rx['rt67'],'has','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        背托宽度：
                        <input type="text" class="input"  style="width: 100px" name="rt68" value="{$rx.rt68}">
                    </div>
                    <div class="controls">
                        背托位置：
                        <input type="text" class="input"  style="width: 100px" name="rt69" value="{$rx.rt69}">
                    </div>
                    <div class="controls">
                        背托免压垫：
                        <select style="width: 101px" name="rt70">
                            {:getFormDictSelectOption($rx['rt70'],'has','rx_tlso',1)}
                        </select>
                    </div>
                </div>
                <hr class="half-rule">

                <div class="control-group">
                    <label class="control-label">切割线：</label>
                    <div class="controls">
                        开口处压片：
                        <select style="width: 74px" name="rt71">
                            {:getFormDictSelectOption($rx['rt71'],'has','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        材料：
                        <input type="text" class="input"  style="width: 100px" name="rt72" value="{$rx.rt72}">
                    </div>
                    <div class="controls">
                        厚度：
                        <input type="text" class="input"  style="width: 100px" name="rt73" value="{$rx.rt73}">
                    </div>
                    <div class="controls">
                        深度：
                        <input type="text" class="input"  style="width: 100px" name="rt74" value="{$rx.rt74}">
                    </div>
                </div>
                <hr class="half-rule">

                <div class="control-group">
                    <label class="control-label">加垫：</label>
                    <div class="controls">
                        1：
                        <input type="text" class="input"  style="width: 700px" name="rt75" value="{$rx.rt75}" placeholder="部位： 范围： 材料： 厚度：">
                    </div>
                    <div class="controls">
                        2：
                        <input type="text" class="input"  style="width: 700px" name="rt76" value="{$rx.rt76}" placeholder="部位： 范围： 材料： 厚度：">
                    </div>
                    <div class="controls">
                        3：
                        <input type="text" class="input"  style="width: 700px" name="rt77" value="{$rx.rt77}" placeholder="部位： 范围： 材料： 厚度：">
                    </div>
                </div>
                <hr class="half-rule">

                <div class="control-group">
                    <label class="control-label">尼龙搭扣：</label>
                    <div class="controls">
                        材质：
                        <input type="text" class="input"  style="width: 100px" name="rt78" value="{$rx.rt78}">
                    </div>
                    <div class="controls">
                        宽度：
                        <input type="text" class="input"  style="width: 100px" name="rt79" value="{$rx.rt79}">
                    </div>
                    <div class="controls">
                        位置：
                        <select style="width: 116px" name="rt80">
                            {:getFormDictSelectOption($rx['rt80'],'padpose','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        返回式环：
                        <select style="width: 88px" name="rt81">
                            {:getFormDictSelectOption($rx['rt81'],'material','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        固定说明：
                        <input type="text" class="input"  style="width: 650px" name="rt82" value="{$rx.rt82}">
                    </div>
                </div>
                <hr class="half-rule">

                <div class="control-group">
                    <label class="control-label">肩带：</label>
                    <div class="controls">
                        <select style="width: 74px" name="rt83">
                            {:getFormDictSelectOption($rx['rt83'],'has','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        材质：
                        <input type="text" class="input"  style="width: 100px" name="rt84" value="{$rx.rt84}">
                    </div>
                    <div class="controls">
                        宽度：
                        <input type="text" class="input"  style="width: 100px" name="rt85" value="{$rx.rt85}">
                    </div>
                    <div class="controls">
                        返回式环：
                        <select style="width: 88px" name="rt86">
                            {:getFormDictSelectOption($rx['rt86'],'material','rx_tlso',1)}
                        </select>
                    </div>
                    <div class="controls">
                        固定说明：
                        <input type="text" class="input"  style="width: 650px" name="rt87" value="{$rx.rt87}">
                    </div>
                </div>
                <hr class="half-rule">

                <div class="control-group">
                    <label class="control-label">备注：</label>
                    <div class="controls">
                        <textarea style="height:5rem; width: 40rem;" name="note">{$rx.note}</textarea>
                    </div>
                </div>
                <hr class="half-rule">
                <div class="control-group">
                    <label class="control-label">价格：</label>
                    <div class="controls">
                        <input type="text" class="input" style="width: 100px" name="price" value="{$rx.price}">
                        元
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">其它矫形器及价格：</label>
                    <div class="controls">
                        <input type="text" class="input" style="width: 480px" name="other_type" value="{$rx.other_type}">
                        价格：
                        <input type="text" class="input" style="width: 100px" name="other_price" value="{$rx.other_price}">
                        元
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">预计交付日期：</label>
                    <div class="controls">
                        <input type="text" class="input J_date" style="width: 100px" name="delivery_date" value="{$rx.delivery_date}">
                    </div>
                </div>
                <hr class="half-rule">
                <div class="control-group">
                    <div class="controls">
                        <label class="checkbox inline" style="font-weight: bold">
                            <input type="checkbox"  name="completed">完成（勾选后提交处方将无法再次修改）
                        </label>
                    </div>
                </div>

            </fieldset>
            <div class="form-actions">
                <input type="hidden" name="rxId" value="{$rxId}" />
                <input type="hidden" name="id" value="{$id}" />
                <button type="submit" class="btn btn-primary btn_submit ">更新</button>
                <a class="btn" href="__URL__">返回</a>
            </div>
        </form>
    </div>
</div>
<script src="__ROOT__/statics/js/common.js"></script>
</body>
</html>